import { IPanelItem } from '@ibiz/model-core';
import {
  PanelController,
  IPanelItemProvider,
  PanelItemController,
} from '@ibiz-template/runtime';
import { OdooChatController } from './odoo-chat.controller';

/**
 * @description Odoo聊天适配器
 * @export
 * @class OdooChatProvider
 * @implements {IPanelItemProvider}
 */
export class OdooChatProvider implements IPanelItemProvider {
  component: string = 'IBizOdooChat';

  async createController(
    panelItem: IPanelItem,
    panel: PanelController,
    parent: PanelItemController | undefined,
  ): Promise<OdooChatController> {
    const c = new OdooChatController(panelItem, panel, parent);
    await c.init();
    return c;
  }
}
